<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta content="telephone=no,email=no" name="format-detection" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/jquery.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.ext.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/skin/css/mobilecss/charge.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/skin/css/mobilecss/main.css">
    
	<title>个人中心</title>
    <style>
        header>div{
            display: inline-block;
            width: 32%;
            text-align: center;
        }
        header .underline,footer .underline{
            position: absolute;
            top:0%;
            right: 0%;
            text-decoration: none;
        }
        .title{
            font-size:0.9rem;
        }
        .btn{
            padding:0 0.5rem;
            background-color: #fff;
            border: 1px solid #000;
            border-radius: 5px;
            color: #000;
            position: absolute;
            top: 0;
            right: 0;
        }
        footer p{
            position: relative;
        }
        section p{
            margin: 0;
        }
        .special{
            border: none;
            background-color: #FFFFFF;
            padding:0 0.5rem;
        }
        header,section,footer{
            margin: 1rem 0;
        }
        i{
            margin: 0.5rem 0;
            border-color: #ddd;
        }
        .bygone p{
            margin: 0.2rem;
        }
        .bygone p>span{
            display: inline-block;
            width: 49%;
        }
        .bygone p>span:nth-child(1){
           text-align: left;
        }
        .bygone p>span:nth-child(2){
            text-align: right;
        }
        .shadow{
            background-color: #efefef;
            padding: 0.3rem;
        }
        .alert{
            position: fixed;
            top:0;
            left: 0;
            width: 100%;
            background-color: rgba(0,0,0,0.8);
            /*display: none;*/
            height: 100vh;
        }
        .alert>div{
            position: absolute;
            top: 25%;
            width: 70%;
            left: 10%;
            background-color: #FFFFFF;
            padding: 5%;
            font-size: 0.8rem;
            font-family: "microsoft yahei";
        }
        #password,#help,#feedback{
            padding: 0.5rem 0;
        }
        u{
		    background-image: url("${pageContext.request.contextPath}/css/skin/images/salesImages/close.png");
		    background-size: 100% 100%;
		    background-repeat: no-repeat;
		}
		#weixinText{
			position:relative;
	}
	.weixinText img{
		position:absolute;
		right:0%;
		width:5%;
		top:0%;
	}
    </style>
</head>
<body>
    <div class="container" id="div1">
        <header>
        	<p class="title"style="position: relative">公众号充值统计 <span class="underline" id="to_div2" onclick="selectOrderData()">查看充值记录></span></p>
            <div>
                <p class="bond" id="yesterdayShiftId">${yesterdayrderStatVo.money==null?0.0:yesterdayrderStatVo.money}</p>
                <p>昨日充值</p>
            </div>
            <div>
                <p class="bond" id="soldCardId" >${allrderStatVo.money==null?0.0:allrderStatVo.money}</p>
                <p>累计充值</p>
            </div>
            <div>
                <p class="bond" id="leftCardId" >${twoWeekorderStatVo.money==null?0.0:twoWeekorderStatVo.money}</p>
                <p>近15日充值</p>
            </div>
        </header>
        <header>
            <i></i> 
            <p class="title"style="position: relative">分红金额：${user.ticeng} 元
            <span class="underline" id="to_div2" onclick="selectHistoryData()">近15日分红 ${profitFee==null?0:profitFee}元 &nbsp;></span>
            </p>
            
            <div>
                <p class="bond" id="yesterdayShiftId">${yesterdayCard==null?0:yesterdayCard}</p>
                <p>昨日转出</p>
            </div>
            <div>
                <p class="bond" id="soldCardId" >${totalCard==null?0:totalCard}</p>
                <p>累计转出</p>
            </div>
            <div>
                <p class="bond" id="leftCardId" >${playerTotalCard==null?0:playerTotalCard}</p>
                <p>剩余房卡</p>
            </div>
        </header>
        <section>
            <i></i>
            <p class="title">个人信息</p>
            <p>游戏ID：<span id="mobileId">${user.gameUserId}</span></p>
            <p>手机号：<span id="mobileId">${user.phone}</span></p>
            <p style="position: relative" class="weixinText">
            微信：<input  class="special" disabled type="text" id="weixinText" value="${user.outUserId}" placeholder="填写微信有利于推广" >
            <input type="hidden" id="myUserName" value="">
                <img id="editWeixinBtn" src="${pageContext.request.contextPath}/css/skin/images/salesImages/edit.png" style="">
	       		<img id="confirmWeixinBtn" src="${pageContext.request.contextPath}/css/skin/images/salesImages/confirm.png" style="display:none;">
				<img id="cancelWeixinBtn" src="${pageContext.request.contextPath}/css/skin/images/salesImages/cancel.png"  style="right:2rem;display:none;">
			</p>
            <p>注册时间：<span id="joinTimeId"><fmt:formatDate value="${user.createTime}" type="both" pattern="yyyy-MM-dd"  /></span></p>
        </section>
       <section id="contactSection">
            <i></i>
            <p class="title" id="personalContactP">代理信息:</p>
            <p onclick="showProfit()">我的级别：${profitRule.prifitName }  </p>
            <%-- <p>手机号：<span id="superiorMobileId">${parentUser.phone}</span></p>
            <p style="position: relative">微信：<span id="superiorWeixin">${parentUser.outUserId}</span> --%>
        </section>
        <section id="contactSection">
            <i></i>
            <p class="title" id="personalContactP">玩家异常处理:</p>
            <div>玩家ID：<input type="text" id="unLockGameId" value=""> 
            <input type="button" onclick="unLock()" value="解锁玩家">
             </div>
            <%-- <p>手机号：<span id="superiorMobileId">${parentUser.phone}</span></p>
            <p style="position: relative">微信：<span id="superiorWeixin">${parentUser.outUserId}</span> --%>
        </section>
        <section>
            <p class="title">技术人员设置</p>
            <i></i>
            <div style="text-align: center">
                <button class="btn" style="position: static;padding: 0.5rem 2rem" onclick="unlocktable()">一键解锁表</button>
            </div>
        </section>
        <footer>
            <i></i>
            <p class="title">设置</p>
            <p id="edit_bank"> 收款信息<span class="underline">></span> </p>
            <p id="password"> 修改密码<span class="underline">></span> </p>
            <div style="text-align: center">
                <button class="btn" style="position: static;padding: 0.5rem 2rem" onclick="logoutClick()">退出登录</button>
            </div>
        </footer>
    </div>
    <div class="container" id="div2" style="display: none">
        <header>
            <p class="title"style="position: relative"><span id="to_div1">往日数据</span> <span class="underline" id="selectMonth">筛选月份</span></p>
        </header>
        <section>
            <ul class="bygone" id="dataListUlId">
            </ul>
        </section>
    </div>
    <div class="alert" style="display: none" id="weixinAlert">
        <div>
		    <u style="position: absolute;top: 5%;right: 2%;padding: 0.5rem" class="close" id="weixinClose"></u>
            <p style="color: #666">为了您的账号利益，请验证身份</p>
            <div style="position: relative">
                <input type="text" id="verCodeText" placeholder="输入验证码" style="width: 40%;" onkeyup="value=value.replace(/[^\d]/g,'')">
                <button style="border: 1px solid #000;color: #3194ff;background-color: #FFFFFF;
                                    position: absolute;top: 0;right: 0" onclick="getVer();">获取验证码</button>
                <button style="width: 100%;margin-top: 1rem" id="validate" onclick="setWeixin();">验证</button>
            </div>
        </div>
    </div> 
    <div class="alert" style="display: none" id="month">
        <div >
            <u style="position: absolute;top: 5%;right: 2%;padding: 0.5rem" class="close"></u>
            <p>选择月份</p>
            <select style="width: 100%" id="sel">
            </select>
        </div>
    </div>
    <script type="text/javascript">
    
	    $("#editWeixinBtn").click(function () {
			$("#editWeixinBtn").css("display","none");
			$("#cancelWeixinBtn").css("display","block");
			$("#confirmWeixinBtn").css("display","block");
			$("#weixinText").removeAttr("disabled");
			$("#weixinText").focus();
		});
    	
	    
	    $("#cancelWeixinBtn").click(function () {
			$("#editWeixinBtn").css("display","block");
			$("#cancelWeixinBtn").css("display","none");
			$("#confirmWeixinBtn").css("display","none");
			$("#weixinText").attr("disabled","disabled");
		});
	    
		$("#confirmWeixinBtn").click(function () {
			var weixin = $.trim($("#weixinText").val());
			//校验微信号
			var reg = /^[a-zA-Z\d_]{6,20}$/;
			if(!(reg.test(weixin))) {
				layer.alert('微信号不符合规则，6~20个字符串。');
				return
			}
			/* $("input.special").attr("disabled","disabled");
		    $("#weixinAlert").css("display","block"); */
			
		    $("#editWeixinBtn").css("display","block");
			$("#cancelWeixinBtn").css("display","none");
			$("#confirmWeixinBtn").css("display","none");
		    
			$.post("${pageContext.request.contextPath}/admin/user_info_edit.html",
		            {"outUserName":weixin},
		       function(data){
		            	var json = eval("("+data+")");
		            	$('#usersave').removeAttr("disabled");  //移除disabled属性 
						layer.alert(json.message);
						if(json.statusCode =='200'){
							
						}else{
							
						}
		      });
	    });
		
		function showProfit(){
			document.location.href = "${pageContext.request.contextPath}/admin/notice_profitRule_mobile.html";
		}
		
		
		function unLock(){
			var gameUserId= $("#unLockGameId").val();
			if(gameUserId==""){
				alert("请输入游戏ID");
				return;
			}
	    	var msg = "解锁该用户 ？";
	    	layer.confirm('确认'+msg, {
	    	    btn: ['确认','取消'], //按钮
	    	    shade: false //不显示遮罩
	    	}, function(){
	    	    $.post("${pageContext.request.contextPath}/admin/player_unlock.html",
	    	            {"gameUserId":gameUserId},
	    	       function(data){
	    	            	var json = eval("("+data+")");
	    	            	$('#usersave').removeAttr("disabled");  //移除disabled属性 
	    					if(json.statusCode =='200'){
	    						layer.msg(json.message, {icon: 1});
	    						setTimeout("query()",2000);
	    					}else{
		    					layer.msg(json.message, {shift: 6});
	    					}
	    	      });
	    	});
		 } 
		
		function unlocktable() {
			var msg =" 确定要清理锁表吗？ ";
	    	layer.confirm(msg, {
	    	    btn: ['确认','取消'], //按钮
	    	    shade: false //不显示遮罩
	    	}, function(){
			
				$.post("${pageContext.request.contextPath}/admin/unlockTable.html",
			            {"outUserName":null},
			       function(data){
			            	var json = eval("("+data+")");
			            	$('#usersave').removeAttr("disabled");  //移除disabled属性 
							layer.alert(json.message);
			      });
				
	    	 });
	    }
		
	    $("#password").click(function () {
	    	document.location.href = "${pageContext.request.contextPath}/admin/updatepwd_mobile.html";
	    });
	    
	    $("#edit_bank").click(function () {
	    	document.location.href = "${pageContext.request.contextPath}/admin/update_bank_mobile.html";
	    });
		
	    /* $("#scNotice").click(function () {
	    	document.location.href = "${pageContext.request.contextPath}/admin/param_notile_mobile.html";
	    }); */
	    
	    
		function logoutClick() {
	    	 top.document.location.href = "${pageContext.request.contextPath}/admin/logout.html";
	    }
	    
	    function selectHistoryData(){
	    	document.location.href = "${pageContext.request.contextPath}/admin/profit_mobile.html";
	    }
	    
	    function selectOrderData(){
	    	document.location.href = "${pageContext.request.contextPath}/admin/order_mobile.html";
	    }
		
    </script>
